<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <p:panelGrid id="bloque2" columns="2" style="width:100%">
        <p:panelGrid columns="2">
            <p:commandButton id="commandButtonAgregarMeta" icon="ui-icon-check"   value="Agregar Meta"
                             actionListener="#{objetivoEstrategicoController.addMeta}" 
                             update=":crudOE:tabView1:dataScrollerMeta,inputTextareaMeta" />
            <p:inputTextarea id="inputTextareaMeta"
                             value="#{objetivoEstrategicoController.meta.descripcion}"
                             title="Meta nueva"
                             placeholder="Ingrese aqui una meta nueva"/>
        </p:panelGrid>
        <h:panelGroup id="panelGroupMeta">
            <p:dataScroller value="#{objetivoEstrategicoController.itemsMeta}" var="item" chunkSize="10" id="dataScrollerMeta">
                <f:facet name="header">
                    <h:outputText value="METAS"/>
                </f:facet>
                <h:panelGrid columns="2" style="width:100%">

                    <h:outputText value="#{item.descripcion}"/>
                    <p:commandButton id="commandButtonEliminarMeta" icon="ui-icon-closethick"   
                                     actionListener="#{objetivoEstrategicoController.deleteItemsMeta(item)}" 
                                     update=":crudOE:tabView1:dataScrollerMeta" />
                    <span class="ui-separator">
                        <span class="ui-icon  ui-icon-grip-dotted-horizontal" />
                    </span>
                </h:panelGrid> 

            </p:dataScroller>
        </h:panelGroup>

    </p:panelGrid>

</html>
